# $NetBSD$

.include "../../wip/libjxl/Makefile.common"
COMMENT=	JpegXL reference codec

TOOL_DEPENDS+=	asciidoc-[0-9]*:../../textproc/asciidoc

USE_TOOLS+=	pkg-config
USE_LANGUAGES=	c c++
USE_CMAKE=	yes

CMAKE_ARGS+=	-DJPEGXL_VERSION=${PKGVERSION_NOREV}
CMAKE_ARGS+=	-DJPEGXL_FORCE_SYSTEM_BROTLI=ON
CMAKE_ARGS+=	-DJPEGXL_FORCE_SYSTEM_HWY=ON
CMAKE_ARGS+=	-DJPEGXL_FORCE_SYSTEM_LCMS2=ON
CMAKE_ARGS+=	-DJPEGXL_ENABLE_DOXYGEN=OFF
CMAKE_ARGS+=	-DJPEGXL_ENABLE_JPEGLI=OFF
CMAKE_ARGS+=	-DJPEGXL_ENABLE_SJPEG=OFF
CMAKE_ARGS+=	-DJPEGXL_ENABLE_SKCMS=OFF
CMAKE_ARGS+=	-DJPEGXL_ENABLE_PLUGINS=OFF
# test are run during the build stage
CMAKE_ARGS+=	-DBUILD_TESTING=OFF

REPLACE_BASH=	deps.sh

PKGCONFIG_OVERRIDE+=	lib/jxl/libjxl.pc.in
PKGCONFIG_OVERRIDE+=	lib/jxl/libjxl_cms.pc.in
PKGCONFIG_OVERRIDE+=	lib/threads/libjxl_threads.pc.in

.include "../../archivers/brotli/buildlink3.mk"
.include "../../graphics/libavif/buildlink3.mk"
.include "../../graphics/giflib/buildlink3.mk"
.include "../../graphics/openexr/buildlink3.mk"
.include "../../graphics/lcms2/buildlink3.mk"
.include "../../graphics/libwebp/buildlink3.mk"
.include "../../graphics/png/buildlink3.mk"
.include "../../graphics/libhighway/buildlink3.mk"
.include "../../mk/jpeg.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
